package cn.pfz.Service.impl;

import cn.pfz.Service.IConsumptionItemService;
import cn.pfz.domain.ConsumptionItem;
import cn.pfz.domain.ConsumptionItemKey;
import cn.pfz.mapper.ConsumptionItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 普发忠
 * @Date: 2021/09/14/14:51
 */
@Service
public class IConsumptionItemServiceimpl implements IConsumptionItemService {
    @Autowired
    private ConsumptionItemMapper consumptionItemMapper;
    
    @Override
    public int deleteByPrimaryKey(Long id) {
        return consumptionItemMapper.deleteByPrimaryKey(new ConsumptionItemKey(id));
    }
    
    @Override
    public int insert(ConsumptionItem record) {
        return consumptionItemMapper.insert(record);
    }
    
    @Override
    public ConsumptionItem selectByPrimaryKey(Long id) {
        return consumptionItemMapper.selectByPrimaryKey(new ConsumptionItemKey(id));
    }
    
    @Override
    public List<ConsumptionItem> selectAll() {
        return consumptionItemMapper.selectAll();
    }
    
    @Override
    public int updateByPrimaryKey(ConsumptionItem record) {
        return consumptionItemMapper.updateByPrimaryKey(record);
    }
    
    @Override
    public List<ConsumptionItem> selectByCno(String cno) {
        return consumptionItemMapper.selectByCno(cno);
    }
    
    @Override
    public void deleteByCno(String cno) {
        consumptionItemMapper.deleteByCno(cno);
    }
}
